﻿using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ManagementCMS.Tool.Log4
{
    public class Log4Helper
    {
        private static readonly ILog loginfo = LogManager.GetLogger("loginfo");

        private static readonly ILog logerror = LogManager.GetLogger("logerror");

        /// <summary>
        /// 打印日志信息
        /// </summary>
        /// <param name="info"></param>
        public static void WriteInfo(string info)
        {
            loginfo.Info(info);
        }

        /// <summary>
        /// 错误日志信息
        /// </summary>
        /// <param name="info"></param>
        /// <param name="ex"></param>
        public static void WriteError(string info, Exception ex)
        {
            logerror.Error(info, ex);
        }

    }
}
